﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using TjZheng.Domain.DataEntity;

namespace TjZheng.Controls
{
    public abstract class UpLoadBase
    {
        protected UploadLimit UploadLimit { get; set; }
        public UpLoadBase(UploadLimit uploadLimit)
        {
            if (uploadLimit == null)
            {
                throw new ArgumentNullException("上传限制不能为空");
            }
            this.UploadLimit = uploadLimit;
        }

        public abstract string SaveFile(Stream objInputStream, string fileExtension);
        public abstract string SaveFile(byte[] uploadFileBytes, string fileExtension);
        public abstract string SaveFile(HttpPostedFileBase objFile);
        public abstract string SaveFile(HttpPostedFile objFile);
        //public abstract string SaveImage(HttpPostedFileBase objFile, int width, int height);
        //public abstract string SaveImage(HttpPostedFile objFile, int percentage);
    }
}
